Draw Context Data Structure
QuickDraw 3D defines the
draw context data structure
to maintain information that is common to all the supported draw contexts. The draw context data structure is defined by the
TQ3DrawContextData
data type.
typedef struct TQ3DrawContextData {
TQ3DrawContextClearImageMethod clearImageMethod;
TQ3ColorARGB clearImageColor;
TQ3Area pane;
TQ3Boolean paneState;
TQ3Bitmap mask;
TQ3Boolean maskState;
TQ3Boolean doubleBufferState;
} TQ3DrawContextData;
-
clearImageMethod
-
A constant that indicates how the drawing destination should be cleared. You can use these constants to specify a method to clear the image.
typedef enum TQ3DrawContextClearImageMethod {
kQ3ClearMethodNone,
kQ3ClearMethodWithColor,
} TQ3DrawContextClearImageMethod;
-
The constant
kQ3ClearMethodNone
indicates that the drawing destination should not be cleared. The exact behavior when
Q3View_StartRendering
is called is renderer-dependent. For example, some renderers expect to redraw every pixel in the drawing destination. By specifying
kQ3ClearMethodNone
, you allow those renderers to apply optimizations during rendering. The constant
kQ3ClearMethodWithColor
indicates that the drawing destination should be cleared with the color specified in the
clearImageColor
field.
-
clearImageColor
-
The color to be used when clearing the drawing destination with a color. This field is ignored unless the value in the
clearImageMethod
field is
kQ3ClearMethodWithColor
.
-
pane
-
The rectangular area (specified in window coordinates) in the drawing destination within which all drawing occurs. If the output pane is smaller than the window's port rectangle, the image is scaled (not clipped) to fit into the pane.
-
paneState
-
A Boolean value that determines whether the area specified in the
pane
field is to be used (
kQ3True
) or is to be ignored (
kQ3False
). Set this field to
kQ3False
to use the entire window as the output pane. If this field is set to
kQ3True
, the
pane
field must contain a valid area.
-
mask
-
A bitmap that is used to mask out certain portions of the drawing destination. Each bit in the bitmap corresponds to a pixel in the drawing area. If a bit is set, the corresponding pixel is drawn; if a bit is clear, the corresponding pixel is not drawn. If the value in this field is
NULL
, the entire window is used as the clipping region.
-
maskState
-
A Boolean value that determines whether the mask specified in the
mask
field is to be used (
kQ3True
) or is to be ignored (
kQ3False
). If this field is set to
kQ3True
, the
mask
field must contain a valid bitmap.
-
doubleBufferState
-
A Boolean value that determines whether double buffering is to used for the drawing destination (
kQ3True
) or not (
kQ3False
). When double buffering is enabled, the back buffer is the active buffer.
© 1997 Apple Computer, Inc.
Previous | QD3D Book | Overview | Chapter Contents | Next |